import umiReq from '@/utils/request';

const root = '/api',
// const root = 'https://carpool.shanch.cn/api',
  get = 'GET',
  post = 'POST',
  form = 'form';

// login
export function login(params: any) {
  return umiReq(root + '/wechat/skipLogin', params, get);
}

// data list
export function getList(params: any) {
  return umiReq(root + '/order/list', params, get);
}

// select route info
export function getRouteInfo(params: any) {
  return umiReq(root + '/route/info', params, get);
}

// new publish
export function addPublish(params: any) {
  return umiReq(root + '/order/add', params, form);
}

// remove publish
export function removePublish(params: any) {
  return umiReq(root + '/order/deleteByUser', params, post);
}

// get QR
export function getQR(params: any) {
  return umiReq(root + '/route/QRCode', params, get);
}

// userInfo
export function getUserInfo(params: any) {
  return umiReq(root + '/user/info', params, get);
}
